import { post } from "../utils/request";
//买断
export const buy = (params) => {
  return post(getApp().globalData.apiUrl + 'order/buy', params);
}

//取消订单
export const cancelOrder = (params) => {
  return post(getApp().globalData.bnUri + 'order/cancel', params);
}

//确认收货
export const confirmDelivery = (params) => {
  return post(getApp().globalData.apiUrl + 'order/confirmDelivery', params);
}

// 提交订单，获取待确认订单列表
export const initOrder = (params) => {
  return post(getApp().globalData.bnUri + 'order/checkout/init', params);
}

// 更新订单结算信息
export const updateOrder = (params) => {
  return post(getApp().globalData.bnUri + 'order/checkout/update', params)
}

export const getAvailableCoupons = (params) => {
  return post(getApp().globalData.bnUri + 'order/checkout/extra', params)
}

//确认归还
export const confirmReturn = (params) => {
  return post(getApp().globalData.apiUrl + 'order/confirmReturn', params);
}

// 获取最迟发货时间
export const getLateDeliveryTime = (params) => {
  return post(getApp().globalData.apiUrl + 'order/getLateDeliveryTime', params);
}

// 获取订单详情
export const getOrderDetail = (params) => {
  return post(getApp().globalData.apiUrl + 'order/getOrderDetail', params);
}
// 获取个人订单列表
export const getOrderList = (params) => {
  return post(getApp().globalData.bnUri + 'order/list', params);
}
// 查看结算单
export const getSettle = (params) => {
  return post(getApp().globalData.apiUrl + 'order/getSettle', params);
}
// 支付
export const payOrder = (params) => {
  return post(getApp().globalData.bnUri + 'order/checkout/pay', params);
}
//续租 
export const renewal = (params) => {
  return post(getApp().globalData.apiUrl + 'order/renewal', params);
}

//提交订单生成冻结订单 
export const submitFreeze = (params) => {
  return post(getApp().globalData.bnUri + 'order/checkout/freeze', params);
}

//支付成功后获取合同签约参数
export const getSignInfo = (params) => {
  return post(getApp().globalData.apiUrl + 'order/getSignInfo', params);
}

// 获取就近门店接口
export const getNearShopList = (params) => {
  return post(getApp().globalData.apiUrl + 'order/getNearShopList', params);
}
// 获取个人中心图标tag
export const getUserCenterTag = (params) => {
  return post(getApp().globalData.bnUri + 'order/stat', params);
}

